<?php

/**
 * @author Radovan Dvorsky
 * @version 20100220
 */
require_once ('application/default/models/Db/Model/ModelAbstract.php');

class Db_Model_Commission extends Db_Model_Abstract {
	
	protected $cid;
	protected $name;
	protected $professors = array();	
	
	/**
	 * @return the $cid
	 */
	public function getCid() {
		return $this->cid;
	}

	/**
	 * @return the $name
	 */
	public function getName() {
		return $this->name;
	}

	/**
	 * @return the $professors
	 */
	public function getProfessors() {
		return $this->professors;
	}

	/**
	 * @param $cid the $cid to set
	 */
	public function setCid($cid) {
		$this->cid = $cid;
	}

	/**
	 * @param $name the $name to set
	 */
	public function setName($name) {
		$this->name = $name;
	}

	/**
	 * @param array $professors
	 */
	public function setProfessors(array $professors) {		
		$this->professors = $professors;
	}
	
	
	public function addProfessor(Db_Model_Professor $professor){
		
		if(!$professor instanceof Db_Model_Professor){
			throw new Exception('$professor is not instance of Db_Model_Professor');
		}
		
		$this->professors[] = $professor;	
		
	}
	
	public function addProfessors(array $professors){
		
		if(is_array($professors)){
			foreach($professors as $professor){
				$this->addProfessor($professor);
			}		
		}
	}
}

?>